package com.example.myandroidtest;

import java.util.ArrayList;
import java.util.HashMap;
import android.os.Bundle;
import android.app.Activity;
import android.widget.ListView;
import android.widget.SimpleAdapter;

public class ImageList extends Activity {

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_image_list);
		ListView lv = (ListView) this.findViewById(R.id.ltvImageList);
		ArrayList<HashMap<String, Object>> al = new ArrayList<HashMap<String, Object>>();
		HashMap<String, Object> map1 = new HashMap<String, Object>();
		map1.put("imagename", "test");
		map1.put("image", R.drawable.image1);
		map1.put("imagedesc", "test");
		al.add(map1);

		HashMap<String, Object> map2 = new HashMap<String, Object>();
		map2.put("imagename", "test");
		map2.put("image", R.drawable.image2);
		map2.put("imagedesc", "test3");
		al.add(map2);

		HashMap<String, Object> map3 = new HashMap<String, Object>();
		map3.put("imagename", "test");
		map3.put("image", R.drawable.image3);
		map3.put("imagedesc", "test3");
		al.add(map3);

		SimpleAdapter sa = new SimpleAdapter(this, al,
				R.layout.activity_image_imageitem, new String[] { "imagename",
						"image", "imagedesc" }, new int[] { R.id.imagename,
						R.id.itemimage, R.id.imagedesc });
		lv.setAdapter(sa);
	}

	
	
	
	

}
